<?php
$query 	= "select * from radio_show where day = ". date('N');
$result = mysql_query ($query) ; 
if (mysql_num_rows($result)) {
		$txt = "<center><table border=\"0\" width=\"66%\"><tr>
			<td width=\"25%\">".GetLangString($lang,"txt_dj")."</td><td width=\"25%\">".GetLangString($lang,"txt_start")."</td><td width=\"25%\">".GetLangString($lang,"txt_stop")."</td></tr>";

	while ($todayshow 	= mysql_fetch_array($result)) {
		$query2 		= "select `name` from `radio_dj` where `id`=".$todayshow['dj'];
		$result2 		= mysql_query ($query2) ; 
		if ($result2) {

	
				$todayname = mysql_result($result2,0);				
				$query3 	= "select * from radio_exception where dj='".$todayshow['dj']."' and date = ". date('Ymd');
				$result3 = mysql_query ($query3) ; 
				if (mysql_num_rows($result3)) {
					$txt .= "<tr><td>".str_ireplace("%name%",$todayname, GetLangString	( $lang			, "msg_radioshowcancelled" ))."</td></tr>";
 				} else {	
					$start = $todayshow['start']; 
					$stop 	= $todayshow['stop']; 
					$txt .= "<tr><td>$todayname</td><td>$start</td><td>$stop</td></tr>";
			}
		}
	} 
			$txt .= "</table>"; 

} else {
	$txt = GetLangString	( $lang			, "msg_todaynoshow" );
}

$SITE_MIDDLE .= FormatElement ( GetLangString ( $lang , "txt_todaysshow" ), $txt) ; 
unset($txt);
//-- extra

$query 	= "select * from radio_extra where date = ". date('Ymd');
$result = mysql_query ($query) ; 
if (mysql_num_rows($result)) {
		$txt = "<center><table border=\"0\" width=\"66%\"><tr>
			<td width=\"25%\">".GetLangString($lang,"txt_dj")."</td><td width=\"25%\">".GetLangString($lang,"txt_start")."</td><td width=\"25%\">".GetLangString($lang,"txt_stop")."</td></tr>";

	while ($todayshow 	= mysql_fetch_array($result)) {
		$query2 		= "select `name` from `radio_dj` where `id`=".$todayshow['dj'];
		$result2 		= mysql_query ($query2) ; 
		if ($result2) {

	
				$todayname = mysql_result($result2,0);				
				$query3 	= "select * from radio_exception where dj='".$todayshow['dj']."' and date = ". date('Ymd');
				$result3 = mysql_query ($query3) ; 
				if (mysql_num_rows($result3)) {
					$txt .= "<tr><td>".str_ireplace("%name%",$todayname, GetLangString	( $lang			, "msg_radioshowcancelled" ))."</td></tr>";
 				} else {	
					$start = $todayshow['start']; 
					$stop 	= $todayshow['stop']; 
					$txt .= "<tr><td>$todayname</td><td>$start</td><td>$stop</td></tr>";
			}
		}
	} 
			$txt .= "</table>"; 
	$SITE_MIDDLE .= FormatElement ( GetLangString ( $lang , "txt_extrashow" ), $txt) ; 

}
?>
